<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
	<form action="?">
		<div class="tt">订购信息搜索</div>
		<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
		<input type="hidden" name="action" value="<?php echo $action;?>"/>
		<table cellpadding="2" cellspacing="1" class="tb">
			<tr>
				<td>
					&nbsp;<?php echo $fields_select;?>&nbsp;
					<input type="text" size="30" name="kw" value="<?php echo $kw;?>" title="关键词"/>&nbsp;
					<?php echo $order_select;?>&nbsp;
					<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" title="条/页"/>
					<input type="submit" value="搜 索" class="btn"/>&nbsp;
					<input type="button" value="重 置" class="btn" onclick="window.location='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>';"/>
				</td>
			</tr>
			<tr>
				<td>
					&nbsp;<select name="datetype">
						<option value="buytime" <?php if ($datetype == 'buytime') echo 'selected';?>>订购日期</option>
						<option value="sendtime" <?php if ($datetype == 'sendtime') echo 'selected';?>>发货日期</option>
					</select>&nbsp;
					<?php echo Post::calender('fromdate', $fromdate, 'width:90'); ?>至 <?php echo Post::calender('todate', $todate, 'width:90', true); ?>&nbsp;
					<?php echo $status_select;?>&nbsp;
					<?php echo ajax_area_select('areaid', '所在地区', $areaid);?>&nbsp;
				</td>
			</tr>
		</table>
	</form>
	<form method="post">
		<div class="tt"><?php echo $menus[$menuid][0];?></div>
		<table cellpadding="2" cellspacing="1" class="tb">
			<tr >
				<th width="25"><input type="checkbox" onclick="checkall(this.form);"/></th>
				<th width="60">联系人</th>
				<th width="90">电话</th>
				<th width="80">手机</th>
				<th width="170">联系地址</th>
				<th width="130">电子邮件</th>
				<th width="70">订购时间</th>
				<th width="70">发货时间</th>
				<th width="80">订购会员</th>
				<th width="40">状态</th>
				<th width="30">数量</th>
				<th width="50">付款金额</th>
				<th width="80">操作</th>
			</tr>
			<?php foreach ($lists as $k => $v) { ?>
				<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center" >
					<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td>
					<td><?php echo $v['truename'];?></td>
					<td><?php echo $v['telephone'];?></td>
					<td><?php echo $v['mobile'];?></td>
					<td>
						<span style="color:#444"><?php echo area_pos($v['areaid'],' ','','3421');?></span>
						<br/>
						<?php echo $v['address'];?>
					</td>
					<td><?php echo $v['email'];?></td>
					<td>
						<a title="<?php echo date('Y-m-d H:i:s',$v['buytime']);?>" style="cursor: pointer">
							<?php echo date('Y-m-d',$v['buytime']);?>
						</a>
					</td>
					<td><?php if($v['sendtime']){ ?>
							<a title="<?php echo date('Y-m-d H:i:s',$v['sendtime']);?>" style="cursor: pointer">
								<?php echo date('Y-m-d',$v['sendtime']); ?></a>
							<?php } else {?>未发货<?php }?></td>
					<td>
						<a href="javascript:_user('<?php echo $v["username"];?>');"><?php echo $v['username'];?></a>
					</td>
					<td>
						<?php if($v['status'] == 1) { ?><strong  style="color:#888;"> 未付款 </strong> <?php }?>
						<?php if($v['status'] == 2) { ?><strong  style="color:#EA0000;">已付款</strong> <?php }?>
						<?php if($v['status'] == 3) { ?><strong  style="color:#006000;">已发货</strong> <?php }?>
						<?php if($v['status'] == 4) { ?><strong  style="color:#EA0000;">支付异常</strong> <?php }?>
					</td>
					<td class="px11">
						<?php echo $v['buynum']?>
					</td>
					<td class="px11">
						<a title="现金支付：<?php echo $v['money'];?> 讯都账户支付：<?php echo $v['xdmoney'];?>" style="cursor: pointer"><?php echo $v['money']+ $v['xdmoney']?>元</a>
					</td>
					<td>
						<?php if($v['status'] == 2 ) { ?>
						<a href="?moduleid=<?php echo $moduleid;?>&action=send&itemid=<?php echo $v['itemid'];?>" onclick="return confirm('确定要发货吗？此操作不可撤销')"><img src="admin/image/email.gif" width="16" height="16" title="发货提醒(邮件)" alt=""/></a>&nbsp;
						<?php }?>
						<a href="javascript:_owncardbuy('<?php echo $v["itemid"];?>');"><img src="admin/image/note.png" width="16" height="16" title="用户附言" alt=""/></a>
						<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a>
					</td>
				</tr>
			<?php }?>
		</table>
		<div class="btns">
			<input type="submit" value=" 彻底删除 " class="btn" onclick="if(confirm('确定要删除选中订购信息吗？此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&action=delete'}else{return false;}"/>&nbsp;
			<input type="submit" value="批量导出 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>;?>&action=export&all=0';"/>
			<input type="submit" value="全部导出 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>;?>&action=export&all=1';"/>
		</div>
	</form>
	<div class="pages"><?php echo  $do->getPn()->render();?></br>
	<span>共<?php echo $items;?>条/<?php echo $do->getPn()->getPages();?>页&nbsp;
		<?php if ($do->getPn()->getPages()>1){;?>
		到第</span>
		<input type="text" name="page-num-input" id="xd_page_jump"/>
		<span>页</span>
		<button type="submit" onclick="xdChangeAndLocation('page', $('#xd_page_jump').val())">确定</button>
		<?php };?></div>
	<br/>
	<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer'); ?>